package capitulo2;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JFrame;

@SuppressWarnings("serial")
public class Exercise1 extends JFrame{

	Computer ordenador;
	Laptop portatil;
	
	
	public Exercise1() {
		super("Exercise1");
		setSize(600,400);
		setVisible(true);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		// Inicializar las variables
		ordenador = new Computer("PC", 1024);
		portatil = new Laptop("Portatil", 2048, Color.BLACK);
	}

	public void paint(Graphics g){
		// 
		g.setColor(Color.white);
		g.fillRect(0, 0, 600, 400);
		g.setFont(new Font("Verdana",Font.PLAIN, 14));
		g.setColor(Color.DARK_GRAY);
		
		g.drawString("Ordenador - " + ordenador.showInfo(), 20,60);
		// g.drawString("Ordenandor - Ram: " + ordenador.getRam(), 20,80);
		
		g.drawString("Portatil - " + portatil.showInfo(), 20,100);
		//g.drawString("Portatil - Model: " + ordenador.getRam(), 20,120);	
	}

	public static void main(String[] args) {
		new Exercise1();
	}

}
